package com.zjh.technews.model.page;

import com.jfinal.kit.StrKit;
import com.jfinal.plugin.activerecord.Record;
import com.yaowk.common.model.Page;

/**
 * Created by zZz on 2017/5/25 0025.
 */
public class NotificationPage extends Page {

    private String beginTime;
    private String endTime;
    private String title;
    private String platformId;

    public String getPlatformId() {
        return platformId;
    }

    public void setPlatformId(String platformId) {
        this.platformId = platformId;
    }

    public String getBeginTime() {
        return beginTime;
    }

    public void setBeginTime(String beginTime) {
        this.beginTime = beginTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Override
    public Record toRecord() {
        Record record = new Record()
                .set("beginTime", beginTime)
                .set("endTime", endTime)
                .set("platformId",platformId);
        if (StrKit.notBlank(title)) {
            record.set("title", "%" + title + "%");
        }
        return record.removeNullValueColumns();
    }

}
